Backport of VAULT-14048: raft-autopilot appears to refuse to remove a node which has left and wouldn't impact stability into release/1.13.x #20436
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport
This PR is auto-generated from #19472 to be assessed for backporting due to the inclusion of the label backport/1.13.x.
The below text is copied from the body of the original PR.
This bug was detected during manual testing for the
1.13.0
release and as a precaution the following PRs were reverted:After some investigation the problem seems to be that the
NodeType
isn't being supplied by Vault when autopilot asks it for itsKnownServers
during pruning. As a result there are no potential voters flagged in the voter registry, we have amaxRemoval
which is< 1
which triggers the debug message about removing a majority of voting servers being unsafe and autopilot refuses to remove the failed voting server.This PR adds the
NodeType
for the leader and, where possible, for the follower nodes. It also restores the autopilot version tov0.2.0
.Files of note:
go.mod
physical/raft/raft_autopilot.go
vault/external_tests/raft/raft_autopilot_test.go
Most other changed files are due to exportingGetRaftBackend
.Tests added:
(Ent)TestDelegate_KnownServers_NodeType
TestRaft_Autopilot_DeadServerCleanup
Following a successfully merged PR I will raise an Enterprise specific PR to update the packages and add another test.
Overview of commits